﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Main.Master" AutoEventWireup="true"
    CodeBehind="Test.aspx.cs" Inherits="NghiSonStyle.Test" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <div style="overflow: scroll; height: 500px;">
        <style type="text/css">
            .Gridview
            {
                font-family: Verdana;
                font-size: 10pt;
                font-weight: normal;
                color: black;
            }
        </style>
        <script type="text/javascript">
            function ShowCurrentTime() 
            {
                $.ajax({
                    type: "POST",
                    url: "Test.aspx/GetCurrentTime",
                    data: '{name: "Linh" }',
                    contentType: "application/json; charset=utf-8",
                    dataType: "json",
                    success: OnSuccess,
                    failure: function (response) {
                        alert(response.d);
                                                 }
                });

                $.ajax({
                    type: "POST",
                    url: "Test.aspx/GetLayer",
                    data: '{name: "Linh" }',
                    contentType: "application/json; charset=utf-8",
                    dataType: "json",
                    success: OnSuccess1,
                    failure: function (response) {
                        alert(response.d);
                    }
                });
            }
            function OnSuccess(response)
             {
                //alert(response.d);
                $(response.d).each(function () {
                    //alert(this);
                    //$('#potentials').append("<option value='" + this + ">");
                    //$("#test").append("<li class='clear'>" + "<img width='70' vspace='2' hspace='4' height='15' src='"+ this +"'  >" + "Đất ao hồ" +  "</li>");

                    $("#test").append("<li class='clear'>" + "<img width='70' vspace='2' hspace='4' height='15' src='" + this.ImagePath + "'  >" + this.ImageName + "</li>");
                    //$("#testaddmenu").append("<li>"+"<a href='#'>"+"<i class='icon-double-angle-right'>"+"</i>"+ this.LayerNameA + "</a>"+"</li>");

                });
            }
            function OnSuccess1(response) {
                //alert(response.d);
                $(response.d).each(function () {
                    //alert(this);
                    //$('#potentials').append("<option value='" + this + ">");
                    //$("#test").append("<li class='clear'>" + "<img width='70' vspace='2' hspace='4' height='15' src='"+ this +"'  >" + "Đất ao hồ" +  "</li>");

                    //$("#test").append("<li class='clear'>" + "<img width='70' vspace='2' hspace='4' height='15' src='" + this.ImagePath + "'  >" + this.ImageName + "</li>");
                    $("#testaddmenu").append("<li>" + "<a href='#'>" + "<i class='icon-double-angle-right'>" + "</i>" + this.LayerNameA + "</a>" + "</li>");

                });
            }


        </script>
        <div>
            <asp:FileUpload ID="fileuploadimages" runat="server" />
            <br />
            <asp:Button ID="btnSubmit" runat="server" Text="Submit" OnClick="btnSubmit_Click" />
            <input id="submitButton" type="button" onclick="ShowCurrentTime()" value="Test ajax" /><br />
            <br />
            <asp:Label ID="Label1" runat="server" Text="Tên"></asp:Label>
            <asp:TextBox ID="Name" runat="server"></asp:TextBox>
            <br />
            <asp:Label ID="Label2" runat="server" Text="Kiểu ( Point : A ; Line : B; Polygon :C)"></asp:Label>
            <asp:TextBox ID="Idimput" runat="server"></asp:TextBox>
            <br />
            <h1>
                Thêm Lớp Menu</h1>
            <br />
            <asp:Label ID="Label3" runat="server" Text="Tên Lớp"></asp:Label>
            <asp:TextBox ID="txtLayerName" runat="server"></asp:TextBox>
            <br />
            <asp:Label ID="Label4" runat="server" Text="Lớp Cha"></asp:Label>
            <asp:DropDownList ID="DropDownList1" runat="server">
            </asp:DropDownList>
            <br />
            <asp:Label ID="Label5" runat="server" Text="Lớp "></asp:Label>
            <asp:TextBox ID="txtLayerType" runat="server"></asp:TextBox>
            <br />
            <asp:Button ID="Button1" runat="server" Text="Thêm lớp" OnClick="Button1_Click" />
            <asp:Label ID="Label6" runat="server" Text="Đang thêm lớp.... "></asp:Label>
            <ul id="test">
            </ul>
            <ul class="nav nav-list">
                <li><a href="#" class="dropdown-toggle"><i class="icon-beer "></i><span class="menu-text">
                    Test add Menu</span><b class="arrow icon-angle-down"> </b></a>
                    <ul id="testaddmenu" class=" submenu">
                    </ul>
                </li>
            </ul>
        </div>
        <div style="overflow: auto;">
            <asp:GridView runat="server" ID="gvImages" AutoGenerateColumns="false" DataSourceID="sqldataImages"
                CssClass="Gridview" HeaderStyle-BackColor="#61A6F8">
                <Columns>
                    <asp:BoundField DataField="ID" HeaderText="ID" />
                    <asp:BoundField DataField="ImageName" HeaderText="Image Name" />
                    <asp:ImageField HeaderText="Image" DataImageUrlField="ImagePath" />
                    <asp:BoundField DataField="Kieu" HeaderText="Kiểu" />
                </Columns>
            </asp:GridView>
            <asp:SqlDataSource ID="sqldataImages" runat="server" ConnectionString="<%$ConnectionStrings:dbconnection %>"
                SelectCommand="select * from ImagesPath"></asp:SqlDataSource>
        </div>
    </div>
</asp:Content>
